@extends('admin.layouts.head')
@section('content')
    <body>
    <div id="app">
        <div class="wrapper -header-fixed">

        @include('admin.layouts.navbar')
        @include('admin.layouts.sidebar')

        <!-- 内容页开始-->
            <div class="content-container">
                <div class="container-fluid">
                    <div class="page-content">

                        <nav aria-label="breadcrumb">
                            <ol class="breadcrumb">
                                <li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">仪表盘</a></li>
                                <li class="breadcrumb-item active" aria-current="page">充值记录</li>
                            </ol>
                        </nav>

                        <div class="card">
                            <div class="card-body">

                                <div class="form-group">
                                    <div class="row">

                                    </div>
                                </div>

                                <div class="table-responsive">
                                    <table class="table table-sm table-hover text-center">
                                        <thead>
                                        <tr>
                                            <th style="min-width:50px;">ID</th>
                                            <th style="min-width:135px;">用户</th>
                                            <th style="min-width:135px;">充值金额</th>
                                            <th style="min-width:165px;">赠送积分</th>
                                            <th style="min-width:165px;">赠送玩服积分</th>
                                            <th style="min-width:165px;">赠送金额</th>
                                            <th style="min-width:165px;">赠送新红包币</th>
                                            <th style="min-width:50px;">支付方式</th>
                                            <th style="min-width:165px;">充值时间</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @foreach($list as $item)
                                            <tr>
                                                <td>{{$item->id}}</td>
                                                <td>{{$item->unionid}}</td>
                                                <td>{{$item->money}}</td>
                                                <td>{{$item->gift_integral}}</td>
                                                <td>{{$item->gift_money}}</td>
                                                <td>{{$item->gift_wf}}</td>
                                                <td>{{$item->gift_hb}}</td>
                                                <td>{{$item->pay_type == 'ALIPAY' ? '支付宝' : '微信支付'}}</td>
                                                <td>{{date('Y-m-d H:i:s',$item->create_time)}}</td>
                                            </tr>
                                        @endforeach
                                        </tbody>
                                    </table>
                                </div>

                            </div> <!-- .card-body -->

                        </div> <!-- .card -->

                        <!-- 分页 -->
                        <nav class="page-card-pagination">
                            <ul class="pagination justify-content-center">
                                {{$list->Links()}}
                            </ul>
                        </nav>
                        <!-- end分页 -->

                    </div> <!-- .page-content -->
                </div> <!-- .container-fluid -->
            </div> <!-- .content-container -->
        </div> <!-- .wrapper -->
    </div> <!-- #app -->
    <script src="{{ mix('js/app.js') }}"></script>
    <script src="{{ asset('/js/main.js') }}"></script>
    <script>
        let isLoading = false;
        //处理
        function handleDraw(id) {
            if (isLoading === false) {
                isLoading = true;

                axios.patch('{{route('admin.recharge.handle','').'/'}}'+id)
                    .then(function (response) {
                        isLoading = false;
                        window.location.reload()
                        // toast_tip2(response.data.message, window.location.href);
                    })
                    .catch(function (error) {
                        isLoading = false;
                        $.each(error.response.data.errors, function (index, object) {
                            toast(object[0]);
                            return false;
                        });
                    })
            }

        }

    </script>
    </body>

@endsection
